import { createRouter, createWebHistory } from 'vue-router';
import IndexView from '../views/index.vue';

const routes = [
  {
    path: '/',
    name: 'home',
    component: IndexView,
  },
  {
    path: '/index',
    name: 'index',
    component: IndexView,
  },
  // 其他路由...
  // 可选：添加通配符路由以捕获所有未定义的路径
  {
    path: '/:pathMatch(.*)*',
    redirect: '/',
  },
];

const router = createRouter({
  history: createWebHistory(),
  routes,
  scrollBehavior(to, from, savedPosition) {
    return false;
  }
});

export default router;